import request from '@/utils/request';
import { type ResponseData } from '@/utils/request';

export interface UploadResultModel {
  fileStoragePath: string;
  name: string;
  nameAndSuffix: string;
  prefix: string;
  randomFileName: string;
  randomFileNameAndSuffix: string;
  size: number;
  suffix: string;
}

export function doUpload(data: FormData): Promise<ResponseData<UploadResultModel>> {
  return request({
    url: '/api/v1/tools/oss/upload',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data',
    },
    data,
  });
} 